package com.mask.im.business.controller.manage;

import com.mask.im.business.annotation.OptLog;
import com.mask.im.business.common.model.PageResult;
import com.mask.im.business.common.model.RestResponse;
import com.mask.im.business.model.dto.ComplaintsDTO;
import com.mask.im.business.model.vo.ConditionVO;
import com.mask.im.business.service.UserComplaintsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import static com.mask.im.business.common.constant.OptTypeConstant.UPDATE;

/**
 * 用户投诉模块
 *
 * @author jian
 */
@Api(tags = "用户投诉管理模块")
@RestController
public class SysComplaintsController {

    @Resource
    private UserComplaintsService userComplaintsService;

    @ApiOperation("获取投诉列表信息")
    @GetMapping("/admin/complaints/list")
    public PageResult<ComplaintsDTO> complaintsList(ConditionVO conditionVO) {
        return userComplaintsService.complaintsList(conditionVO);
    }

    @OptLog(optType = UPDATE)
    @ApiOperation("改变状态")
    @PutMapping("/admin/changeStatus")
    public RestResponse<String> changeStatus(ConditionVO conditionVO) {
        return userComplaintsService.changeStatus(conditionVO);
    }
}

